package com.emuporium.gymrat.android.database;

import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

public class DatabaseProgramAdapter {
	private SQLiteDatabase db;
	// private DatabaseHelper helper;
	private Context context;

	public DatabaseProgramAdapter(Context databaseContext) {
		context = databaseContext;
	}

	public DatabaseProgramAdapter open() throws SQLException {
		// helper = new DatabaseHelper(context);
		db = DatabaseHelper.getStaticDb();
		return this;
	}

	public void close() {
		db.close();
	}

	public Cursor getAll() {
		Log.e("DBADAPTER", "PREQUERY");
		return db.rawQuery("select _id, name from programs", null);
	}

	public Cursor getRoutines(int programId) {
		String[] args = { Integer.toString(programId) };
		return db.rawQuery("", args);
	}
}
